<!DOCTYPE html>
<html>

  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
	<meta http-equiv="Cache-Control" content="no-siteapp" />

    <title>xmake v2.2.7 released, Improve to build Cuda project</title>
    <meta name="description" content="This version mainly makes a lot of improvements to the Cuda project, and adds support for lex/yacc compilation. It also adds custom support for link phases s...">

    
    <meta name="keywords" content="xmake,lua,C/C++,Cuda,tboox" /> 

    <!-- qq oauth -->
    <meta property="qc:admins" content="5211601217706727767255" />

    <!--icon -->
    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">
    <link rel="icon" sizes="192x192" href="/static/img/nice-highres.png" />
	<link rel="apple-touch-icon-precomposed" href="/static/img/apple-touch-icon-57x57-precomposed.png" />
	<link rel="apple-touch-icon-precomposed" sizes="72x72" href="/static/img/apple-touch-icon-72x72-precomposed.png" />
	<link rel="apple-touch-icon-precomposed" sizes="114x114" href="/static/img/apple-touch-icon-114x114-precomposed.png" />
	<link rel="apple-touch-icon-precomposed" sizes="144x144" href="/static/img/apple-touch-icon-144x144-precomposed.png" />
	<link rel="apple-touch-icon-precomposed" sizes="180x180" href="/static/img/retinahd_icon.png" />
	<meta name="msapplication-TileImage" content="/static/img/retinahd_icon.png" />
	
    <link rel="stylesheet" href=" /css/fontawesome/css/font-awesome.min.css ">
    <link rel="stylesheet" href=" /css/main.css ">
    <link rel="canonical" href="https://tboox.org/2019/06/17/xmake-update-v2.2.7/">
    <link rel="alternate" type="application/rss+xml" title="TBOOX Open Source Project" href="https://tboox.org/feed.xml ">
    <link rel="alternate" hreflang="en" href="https://tboox.org/" />
    <link rel="alternate" hreflang="zh-Hans" href="https://tboox.org/cn/" />




    <script type="text/javascript">
    function isPC(){    
        var userAgentInfo = navigator.userAgent;  
        var Agents = new Array("Android", "iPhone", "SymbianOS", "Windows Phone", "iPad", "iPod");    
        var flag = true;    
        for (var v = 0; v < Agents.length; v++) {    
            if (userAgentInfo.indexOf(Agents[v]) > 0) { flag = false; break; }    
        }    
        return flag;    
    }
    </script>

<!-- baidu ads -->



    <!-- baidu ads -->

</head>


  <body>

    <header id="top">
    <div class="wrapper">
        <a href="/" class="brand">TBOOX</a>
        <button id="headerMenu" class="menu"><i class="fa fa-bars"></i></button>
        <nav id="headerNav">
            <ul>
                <li>
                    
                    <a href="/cn?lang=0">
                    
                        <i class="fa fa-home"></i>中文
                    </a>
                </li>

                
                    
                     
                    
                
                    
                     
                     
                    <li>

                        
                            
                            <a href="/project/">
                            
                        
                            <i class="fa fa-bookmark"></i>Projects
                        </a>
                    </li>
                    
                    
                    
                
                    
                     
                    
                
                    
                     
                     
                    <li>

                        
                            
                            <a href="/archive/">
                            
                        
                            <i class="fa fa-archive"></i>Archives
                        </a>
                    </li>
                    
                    
                    
                
                    
                     
                    
                
                    
                     
                     
                    <li>

                        
                            
                            <a href="/category/">
                            
                        
                            <i class="fa fa-th-list"></i>Categories
                        </a>
                    </li>
                    
                    
                    
                
                    
                     
                    
                
                    
                     
                     
                    <li>

                        
                            
                            <a href="/tag/">
                            
                        
                            <i class="fa fa-tags"></i>Tags
                        </a>
                    </li>
                    
                    
                    
                
                    
                
                    
                     
                    
                
                    
                     
                     
                    <li>

                        
                            
                            <a href="/docs/">
                            
                        
                            <i class="fa fa-book"></i>Documents
                        </a>
                    </li>
                    
                    
                    
                
                    
                     
                    
                
                    
                     
                     
                    <li>

                        
                            
                            <a href="https://xmake.io/#/about/contact" target="_blank" >
                            
                        
                            <i class="fa fa-forumbee"></i>Community
                        </a>
                    </li>
                    
                    
                    
                
                    
                     
                    
                
                    
                     
                     
                    <li>

                        
                            
                            <a href="/donation/">
                            
                        
                            <i class="fa fa-heart"></i>Donate
                        </a>
                    </li>
                    
                    
                    
                
                    
                     
                    
                
                    
                     
                     
                    <li>

                        
                            
                            <a href="/about/">
                            
                        
                            <i class="fa fa-user"></i>About
                        </a>
                    </li>
                    
                    
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                     
                     
                    
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            </ul>
        </nav>
    </div>
</header>



        <div class="page clearfix" post>
    <div class="left">
        <h1>xmake v2.2.7 released, Improve to build Cuda project</h1>
        <div class="label">

            <div class="label-card">
                <i class="fa fa-calendar"></i>2019-06-17
            </div>

            <div class="label-card">
                
            </div>

            <div class="label-card">
                
            </div>

            <div class="label-card">
            


<!-- <span class="point">•</span> -->
<span class="categories">
  <i class="fa fa-th-list"></i>
  
    
        <a href="/category/#xmake" title="Category: xmake" rel="category">xmake</a>
    
  

  <!-- <span class="point">•</span> -->
</span>


            </div>

            <div class="label-card">
            
<!-- <span class="point">•</span> -->
<span class="pageTag">
  <i class="fa fa-tags"></i>
  
    
        <!--a href="/tag/#xmake" title="Tag: xmake" rel="tag">xmake</a-->
        <a href="/tag/#xmake" title="Tag: xmake" rel="tag">xmake</a>&nbsp;
    
        <!--a href="/tag/#lua" title="Tag: lua" rel="tag">lua</a-->
        <a href="/tag/#lua" title="Tag: lua" rel="tag">lua</a>&nbsp;
    
        <!--a href="/tag/#C%2FC%2B%2B" title="Tag: C/C++" rel="tag">C/C++</a-->
        <a href="/tag/#C/C++" title="Tag: C/C++" rel="tag">C/C++</a>&nbsp;
    
        <!--a href="/tag/#Cuda" title="Tag: Cuda" rel="tag">Cuda</a-->
        <a href="/tag/#Cuda" title="Tag: Cuda" rel="tag">Cuda</a>
    
  

</span>

            </div>

        </div>
        <hr>
        <article itemscope itemtype="http://schema.org/BlogPosting">
        <p>This version mainly makes a lot of improvements to the Cuda project, and adds support for lex/yacc compilation. 
It also adds custom support for link phases such as <code class="highlighter-rouge">on_link</code>, <code class="highlighter-rouge">before_link</code> and <code class="highlighter-rouge">after_link</code> to the target.</p>

<p>Here, I would also like to thank @<a href="https://github.com/OpportunityLiu">OpportunityLiu</a> for support for xmake. In this version <a href="https://github.com/OpportunityLiu">OpportunityLiu</a> contributed a lot of code to Improve Cuda support.
In addition, he helped improve xmake’s entire unit testing framework, self-updating programs, command line tab completions, and ci scripts to make xmake’s update iterations more efficient and stable.</p>

<ul>
  <li><a href="https://github.com/xmake-io/xmake">project source</a></li>
  <li><a href="https://xmake.io/#/en/">Official Document</a></li>
</ul>

<h2 id="introduction-of-new-features">Introduction of new features</h2>

<h3 id="improve-to-build-cuda-project">Improve to build Cuda project</h3>

<h4 id="header-file-dependency-detection-and-incremental-compilation">Header file dependency detection and incremental compilation</h4>

<p>Prior to 2.2.6, the compiler support for cuda was not perfect. At least the header file dependency detection was not provided. Therefore, if there is more cuda code, every change will compile all, not like c/c++ code. Do it to detect changes and perform incremental compilation.</p>

<p>In the new version, xmake has supported it, and now it is very good to handle dependencies on different platforms, which will improve the efficiency of daily compilation and development.</p>

<h4 id="add-gencodes-api">Add gencodes api</h4>

<p>In the previous version, adding gencodes configuration was very cumbersome and not concise. You can look at the previous configuration:</p>

<div class="language-lua highlighter-rouge"><pre class="highlight"><code><span class="n">target</span><span class="p">(</span><span class="s2">"cuda_console"</span><span class="p">)</span>
<span class="err">    </span><span class="n">set_kind</span><span class="p">(</span><span class="s2">"binary"</span><span class="p">)</span>
<span class="err">    </span><span class="n">add_files</span><span class="p">(</span><span class="s2">"src/*.cu"</span><span class="p">)</span>

<span class="err">    </span><span class="n">add_cuflags</span><span class="p">(</span><span class="s2">"-gencode arch=compute_30,code=sm_30"</span><span class="p">,</span> <span class="s2">"-gencode arch=compute_35,code=sm_35"</span><span class="p">)</span>
<span class="err">    </span><span class="n">add_cuflags</span><span class="p">(</span><span class="s2">"-gencode arch=compute_37,code=sm_37"</span><span class="p">,</span> <span class="s2">"-gencode arch=compute_50,code=sm_50"</span><span class="p">)</span>
<span class="err">    </span><span class="n">add_cuflags</span><span class="p">(</span><span class="s2">"-gencode arch=compute_52,code=sm_52"</span><span class="p">,</span> <span class="s2">"-gencode arch=compute_60,code=sm_60"</span><span class="p">)</span>
<span class="err">    </span><span class="n">add_cuflags</span><span class="p">(</span><span class="s2">"-gencode arch=compute_61,code=sm_61"</span><span class="p">,</span> <span class="s2">"-gencode arch=compute_70,code=sm_70"</span><span class="p">)</span>
<span class="err">    </span><span class="n">add_cuflags</span><span class="p">(</span><span class="s2">"-gencode arch=compute_70,code=compute_70"</span><span class="p">)</span>

<span class="err">    </span><span class="n">add_ldflags</span><span class="p">(</span><span class="s2">"-gencode arch=compute_30,code=sm_30"</span><span class="p">,</span> <span class="s2">"-gencode arch=compute_35,code=sm_35"</span><span class="p">)</span>
<span class="err">    </span><span class="n">add_ldflags</span><span class="p">(</span><span class="s2">"-gencode arch=compute_37,code=sm_37"</span><span class="p">,</span> <span class="s2">"-gencode arch=compute_50,code=sm_50"</span><span class="p">)</span>
<span class="err">    </span><span class="n">add_ldflags</span><span class="p">(</span><span class="s2">"-gencode arch=compute_52,code=sm_52"</span><span class="p">,</span> <span class="s2">"-gencode arch=compute_60,code=sm_60"</span><span class="p">)</span>
<span class="err">    </span><span class="n">add_ldflags</span><span class="p">(</span><span class="s2">"-gencode arch=compute_61,code=sm_61"</span><span class="p">,</span> <span class="s2">"-gencode arch=compute_70,code=sm_70"</span><span class="p">)</span>
<span class="err">    </span><span class="n">add_ldflags</span><span class="p">(</span><span class="s2">"-gencode arch=compute_70,code=compute_70"</span><span class="p">)</span>
</code></pre>
</div>

<p>Therefore, in order to streamline the configuration of xmake.lua, the <code class="highlighter-rouge">add_cugencodes</code>api added to the cuda project is used to simplify the configuration. The improvements are as follows:</p>

<div class="language-lua highlighter-rouge"><pre class="highlight"><code><span class="n">target</span><span class="p">(</span><span class="s2">"cuda_console"</span><span class="p">)</span>
<span class="err">    </span><span class="n">set_kind</span><span class="p">(</span><span class="s2">"binary"</span><span class="p">)</span>
<span class="err">    </span><span class="n">add_files</span><span class="p">(</span><span class="s2">"src/*.cu"</span><span class="p">)</span>

<span class="err">    </span><span class="c1">-- generate SASS code for each SM architecture</span>
<span class="err">    </span><span class="n">add_cugencodes</span><span class="p">(</span><span class="s2">"sm_30"</span><span class="p">,</span> <span class="s2">"sm_35"</span><span class="p">,</span> <span class="s2">"sm_37"</span><span class="p">,</span> <span class="s2">"sm_50"</span><span class="p">,</span> <span class="s2">"sm_52"</span><span class="p">,</span> <span class="s2">"sm_60"</span><span class="p">,</span> <span class="s2">"sm_61"</span><span class="p">,</span> <span class="s2">"sm_70"</span><span class="p">)</span>

<span class="err">    </span><span class="c1">-- generate PTX code from the highest SM architecture to guarantee forward-compatibility</span>
<span class="err">    </span><span class="n">add_cugencodes</span><span class="p">(</span><span class="s2">"compute_70"</span><span class="p">)</span>
</code></pre>
</div>

<p>In addition, when configured as <code class="highlighter-rouge">add_cugencodes("native")</code>, xmake will automatically detect the gencodes supported by the current device, which will be added automatically, which is more convenient and efficient.</p>

<p>This, thanks to the probe code provided by [OpportunityLiu] (https://github.com/OpportunityLiu) and the implementation of <code class="highlighter-rouge">add_cugencodes</code>.</p>

<h4 id="support-device-link-for-cuda">Support device link for cuda</h4>

<p>In the new version, xmake basically refactors the entire cuda build process, extracting the cuda-related builds to a separate cuda build rule for maintenance, and by default uses the device-link link.</p>

<p>For the description and benefits of device-link, please refer to the relevant official introduction: https://devblogs.nvidia.com/separate-compilation-linking-cuda-device-code/</p>

<p>We also need devlink when compiling calls that contain <code class="highlighter-rouge">__global__</code> or <code class="highlighter-rouge">__device__</code> functions that cross compiler units, so in xmake, devlink is currently enabled by default.</p>

<p>For the user, there is no need to make any changes to xmake.lua. Of course, if the user wants to disable devlink manually, it is also possible:</p>

<div class="language-lua highlighter-rouge"><pre class="highlight"><code><span class="n">target</span><span class="p">(</span><span class="s2">"test"</span><span class="p">)</span>
<span class="err">    </span><span class="n">set_kind</span><span class="p">(</span><span class="s2">"binary"</span><span class="p">)</span>
<span class="err">    </span><span class="n">add_files</span><span class="p">(</span><span class="s2">"src/*.cu"</span><span class="p">)</span>
<span class="err">    </span><span class="n">add_values</span><span class="p">(</span><span class="s2">"cuda.devlink"</span><span class="p">,</span> <span class="kc">false</span><span class="p">)</span> <span class="c1">-- explicitly disable the default device-link behavior</span>
</code></pre>
</div>

<h4 id="support-for-compiling-cuda-projects-with-clang">Support for compiling cuda projects with clang</h4>

<p>Clang currently supports compilation of *.cu files, but clan versions supported by different versions of clang have certain limitations. Clang7 can only support cuda7-9.2, 8 supports up to 10, and clan9 is required to support 10.1.</p>

<p>In addition to supporting nvcc to compile cuda projects, xmake can also be compiled directly into clang, for example:</p>

<div class="language-console highlighter-rouge"><pre class="highlight"><code>xmake f --cu=clang
xmake
</code></pre>
</div>

<p>However, regarding devlink, it seems that you still need to rely on nvcc, clang does not support it.</p>

<h4 id="switch-c-compiler-for-nvcc">Switch c++ compiler for nvcc</h4>

<p>xmake added the <code class="highlighter-rouge">--cu-ccbin=</code> parameter to configure the switch. The nvcc defaults to the c++ compiler and linker. The usage is as follows:</p>

<div class="language-console highlighter-rouge"><pre class="highlight"><code>xmake f --cu-ccbin=clang++
xmake
</code></pre>
</div>

<p>Let nvcc call the clang++ compiler internally when compiling cuda code.</p>

<h3 id="custom-the-linking-process">Custom the linking process</h3>

<p>In the new version, we have added customization processing related to the link link phase. Users can extend their own link process by implementing <code class="highlighter-rouge">on_link</code>, <code class="highlighter-rouge">before_link</code> and <code class="highlighter-rouge">after_link</code> in target/rule.</p>

<p>For example, we want to pre-process some other things before the link phase of normal c/c++ code, such as doing something about *.o files, then we can write our own lua script in the before_link stage:</p>

<div class="language-lua highlighter-rouge"><pre class="highlight"><code><span class="n">target</span><span class="p">(</span><span class="s2">"test"</span><span class="p">)</span>
<span class="err">    </span><span class="n">before_link</span><span class="p">(</span><span class="k">function</span> <span class="p">(</span><span class="n">target</span><span class="p">)</span>
<span class="err">        </span><span class="nb">print</span><span class="p">(</span><span class="s2">"process objects"</span><span class="p">,</span> <span class="n">target</span><span class="p">:</span><span class="n">objectfiles</span><span class="p">())</span>
<span class="err">    </span><span class="k">end</span><span class="p">)</span>
</code></pre>
</div>

<p>Or we want to rewrite the built-in link process, you can use <code class="highlighter-rouge">on_link</code>:</p>

<div class="language-lua highlighter-rouge"><pre class="highlight"><code><span class="n">target</span><span class="p">(</span><span class="s2">"test"</span><span class="p">)</span>
<span class="err">    </span><span class="n">on_link</span><span class="p">(</span><span class="k">function</span> <span class="p">(</span><span class="n">target</span><span class="p">)</span>
<span class="err">        </span><span class="nb">print</span><span class="p">(</span><span class="s2">"link objects"</span><span class="p">,</span> <span class="n">target</span><span class="p">:</span><span class="n">objectfiles</span><span class="p">())</span>
<span class="err">    </span><span class="k">end</span><span class="p">)</span>
</code></pre>
</div>

<p>And <code class="highlighter-rouge">after_link</code> is to do some customization tasks after the link is completed.</p>

<h3 id="support-lexyacc-compilation">support Lex/Yacc Compilation</h3>

<p>Currently xmake can natively support lex/flex, yacc/bison, etc. to compile and process <em>.l/</em>.y files to quickly develop some compiler-related projects.</p>

<p>We only need to add lex, yacc two rules to the target, so that it can handle <em>.l/</em>.y files normally, of course <em>.ll/</em>.yy is also supported.</p>

<div class="language-lua highlighter-rouge"><pre class="highlight"><code><span class="n">target</span><span class="p">(</span><span class="s2">"calc"</span><span class="p">)</span>
<span class="err">    </span><span class="n">set_kind</span><span class="p">(</span><span class="s2">"binary"</span><span class="p">)</span>
<span class="err">    </span><span class="n">add_rules</span><span class="p">(</span><span class="s2">"lex"</span><span class="p">,</span> <span class="s2">"yacc"</span><span class="p">)</span>
<span class="err">    </span><span class="n">add_files</span><span class="p">(</span><span class="s2">"src/*.l"</span><span class="p">,</span> <span class="s2">"src/*.y"</span><span class="p">)</span>
</code></pre>
</div>

<p>Here is an example code for reference: <a href="https://github.com/xmake-io/xmake/tree/dev/tests/projects/lex_yacc">lex_yacc_example</a></p>

<h3 id="improve-to-set-run-environments">Improve to set run environments</h3>

<h4 id="setting-the-running-directory">Setting the running directory</h4>

<p>We can use the <code class="highlighter-rouge">set_rundir</code> interface to set the current running directory of the default running target program. If not set, by default, the target is loaded and run in the directory where the executable file is located.</p>

<p>If the user wants to modify the load directory, one is to customize the run logic by <code class="highlighter-rouge">on_run()</code>, and to do the switch inside, but just to cut the directory, this is too cumbersome.</p>

<p>Therefore, you can quickly switch settings to the default directory environment through this interface.</p>

<div class="language-lua highlighter-rouge"><pre class="highlight"><code><span class="n">target</span><span class="p">(</span><span class="s2">"test"</span><span class="p">)</span>
<span class="err">    </span> <span class="n">set_kind</span><span class="p">(</span><span class="s2">"binary"</span><span class="p">)</span>
<span class="err">    </span> <span class="n">add_files</span><span class="p">(</span><span class="s2">"src/*.c"</span><span class="p">)</span>
<span class="err">    </span> <span class="n">set_rundir</span><span class="p">(</span><span class="s2">"$(projectdir)/xxx"</span><span class="p">)</span>
</code></pre>
</div>

<h4 id="adding-the-environment-variables">Adding the environment variables</h4>

<p>Another new interface, <code class="highlighter-rouge">add_runenvs</code>, can be used to add environment variables that set the default run target program.</p>

<div class="language-lua highlighter-rouge"><pre class="highlight"><code><span class="n">target</span><span class="p">(</span><span class="s2">"test"</span><span class="p">)</span>
<span class="err">    </span> <span class="n">set_kind</span><span class="p">(</span><span class="s2">"binary"</span><span class="p">)</span>
<span class="err">    </span> <span class="n">add_files</span><span class="p">(</span><span class="s2">"src/*.c"</span><span class="p">)</span>
<span class="err">    </span> <span class="n">add_runenvs</span><span class="p">(</span><span class="s2">"PATH"</span><span class="p">,</span> <span class="s2">"/tmp/bin"</span><span class="p">,</span> <span class="s2">"xxx/bin"</span><span class="p">)</span>
<span class="err">    </span> <span class="n">add_runenvs</span><span class="p">(</span><span class="s2">"NAME"</span><span class="p">,</span> <span class="s2">"value"</span><span class="p">)</span>
</code></pre>
</div>

<h3 id="support-command-line-tab-completion">Support Command line tab completion</h3>

<p>In order to improve the user experience, the new version also supports the xmake command parameter tab completion under the command line. The user can conveniently and quickly tab out all the command parameters of xmake.</p>

<p>Currently supports zsh/bash/sh and powershell.</p>

<h3 id="more-convenient-self-updating-commands">More convenient self-updating commands</h3>

<p>In previous versions, xmake had provided a convenient self-updating command <code class="highlighter-rouge">xmake update</code> to update xmake’s own version, or even to update the specified branch version, for example: <code class="highlighter-rouge">xmake update dev/master</code></p>

<p>However, there are still some shortcomings:</p>

<ol>
  <li>Every time you update, you need to recompile the core, so the update is very slow. However, in many cases, the new version only has script changes, and the core does not change.</li>
  <li>Update the specified dev/master branch, which is not perfect on Windows, a little lagging, and can’t be instantly synced to the online dev/master version.</li>
</ol>

<p>Therefore, this <a href="https://github.com/OpportunityLiu">OpportunityLiu</a> has helped a lot of improvements:</p>

<ol>
  <li>Provide the <code class="highlighter-rouge">xmake update -s/--scriptonly</code> parameter, just update the lua script, do not compile the core extra, and implement a fast iterative update.</li>
  <li>Improve ci script, implement ci automation build on windows, <code class="highlighter-rouge">xmake update dev</code> automatically pulls pre-built installation package to download update on ci</li>
  <li>You can specify to update xmake from other github repos, so that contributors can update their fork version, and also switch users to repo, <code class="highlighter-rouge">xmake update gitee:tboox/xmake</code></li>
</ol>

<h2 id="changelogs">Changelogs</h2>

<h3 id="new-features">New features</h3>

<ul>
  <li><a href="https://github.com/xmake-io/xmake/issues/440">#440</a>: Add <code class="highlighter-rouge">set_rundir()</code> and <code class="highlighter-rouge">add_runenvs()</code> api for target/run</li>
  <li><a href="https://github.com/xmake-io/xmake/pull/443">#443</a>: Add tab completion support</li>
  <li>Add <code class="highlighter-rouge">on_link</code>, <code class="highlighter-rouge">before_link</code> and <code class="highlighter-rouge">after_link</code> for rule and target</li>
  <li><a href="https://github.com/xmake-io/xmake/issues/190">#190</a>: Add <code class="highlighter-rouge">add_rules("lex", "yacc")</code> rules to support lex/yacc projects</li>
</ul>

<h3 id="changes">Changes</h3>

<ul>
  <li><a href="https://github.com/xmake-io/xmake/pull/430">#430</a>: Add <code class="highlighter-rouge">add_cucodegens()</code> api to improve set codegen for cuda</li>
  <li><a href="https://github.com/xmake-io/xmake/pull/432">#432</a>: support deps analyze for cu file</li>
  <li><a href="https://github.com/xmake-io/xmake/issues/437">#437</a>: Support explict git source for xmake update, <code class="highlighter-rouge">xmake update github:xmake-io/xmake#dev</code></li>
  <li><a href="https://github.com/xmake-io/xmake/pull/438">#438</a>: Support to only update scripts, <code class="highlighter-rouge">xmake update --scriptonly dev</code></li>
  <li><a href="https://github.com/xmake-io/xmake/issues/433">#433</a>: Improve cuda to support device-link</li>
  <li><a href="https://github.com/xmake-io/xmake/issues/442">#442</a>: Improve test library</li>
</ul>


        </article>
        <hr>

        <!-- baidu ads -->
        

        
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
                    
                    <h2 id="chinese">中文</h2>
                    <ul>
                    
                    <li class="relatedPost">
                        <a href="/cn/2019/06/17/xmake-update-v2.2.7/">xmake v2.2.7 发布, 改进Cuda项目构建
                        
                        </a>
                    </li>
                    
                    
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
        
            
        
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
        
            </ul>
        

        
        
            
            
            
                
                    
                        
                        <h2 id="similar_posts">Similar Posts</h2>
                        <ul>
                        
                        <li class="relatedPost">
                            <a href="/2021/12/17/xmake-update-v2.6.2/">Xmake v2.6.2 released, Support building Linux kernel driver module
                            
                            </a>
                        </li>
                        
                        
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
            
            
        
            
        
            
            
            
                
                    
                        
                        <li class="relatedPost">
                            <a href="/2021/12/03/xmake-update-v2.6.1/">xmake v2.6.1 released, Switch to Lua5.4 runtime, Support Rust and C++ mixed compilation
                            
                            </a>
                        </li>
                        
                        
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
            
            
        
            
        
            
            
            
                
                    
                        
                        <li class="relatedPost">
                            <a href="/2021/10/30/xmake-update-v2.5.9/">xmake v2.5.9 released, Improve C++20 Modules and support Nim, Keil MDK and Unity Build
                            
                            </a>
                        </li>
                        
                        
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
            
            
        
            
        
            
            
            
                
                    
                        
                        <li class="relatedPost">
                            <a href="/2021/10/08/xmake-update-v2.5.8/">xmake v2.5.8 is released, Support Pascal/Swig program and Lua53 runtime
                            
                            </a>
                        </li>
                        
                        
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
            
            
        
            
        
            
            
            
                
                    
                        
                        <li class="relatedPost">
                            <a href="/2021/08/29/xmake-update-v2.5.7/">xmake v2.5.7 released, Use lockfile to freeze package dependencies and Vala/Metal language support
                            
                            </a>
                        </li>
                        
                        
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
            
            
        
            
        
        
            </ul>
        

        <div class="post-recent">
    <div class="pre">

        

        

        
        
        

        

        

        
        
        <p><strong>Prev Post</strong> <a href="/2019/05/29/xmake-vs-cmake/">xmake vs cmake</a></p>
        
    </div>

    <div class="nex">

        

        

        
        
        

        

        

        
        
        <p><strong>Next Post</strong> <a href="/2019/08/09/xmake-upload-package/">Create and upload C/C++ packages to xmake's official repository</a></p>
        
    </div>
</div>


        <h2 id="comments">Comments</h2>
        






<div id="gitalk-container"></div>
<link rel="stylesheet" href="/css/gitalk.css">
<script src="/js/gitalk.min.js"></script>

<script>
const gitalk = new Gitalk({
  clientID: '73946dc1d9e2276ad0da',
  clientSecret: '12a3cb94361ba3ebc6ecb68cf80d592bfaa8106d',
  repo: 'tboox.github.io',
  owner: 'waruqi',
  admin: ['waruqi'],
  id: location.pathname,      
  language: 'en',
  distractionFreeMode: false  
})

gitalk.render('gitalk-container')
</script>





    </div>
    <button class="anchor"><i class="fa fa-anchor"></i></button>
    <div class="right">
        <div class="wrap">


            <!-- codefund ads -->
            

            <!-- Content -->
            <div class="side content">
                <div>
                    Content
                </div>
                <ul id="content-side" class="content-ul">
                    <li><a href="#chinese">中文</a></li>
                    <li><a href="#similar_posts">Similar Posts</a></li>
                    <li><a href="#comments">Comments</a></li>
                </ul>
            </div>

            <!-- baidu ads -->
            

            <br>
            <div class="side">
                <div>
                    <i class="fa fa-external-link"></i>
                    Links
                </div>
                <ul class="content-ul">
                  <li><a href="http://github.com/waruqi/tbox">tbox</a></li>
                  <li><a href="http://www.xmake.io">xmake</a></li>
                  <li><a href="https://github.com/waruqi">github</a></li>
                </ul>
            </div> 

            <!-- google ads -->
            

            <!-- baidu ads -->
            

            <!-- chitika ads -->
            
        </div>
    </div>

    <!-- baidu ads -->
    
</div>
<script>
/**
 * target _blank
 */
(function() {
    var aTags = document.querySelectorAll('article a:not([id])')
    for (var i = 0; i < aTags.length; i++) {
        aTags[i].setAttribute('target', '_blank')
    }
}());
</script>
<script src="/js/pageContent.js " charset="utf-8"></script>



    <footer class="site-footer">
    <div class="wrapper">
        <p class="description">
             Copyright (c) 2016-2020 tboox.org 
        </p>
        <p class="contact">
            
            <a href="https://github.com/waruqi" title="GitHub"><i class="fa fa-github" aria-hidden="true"></i></a> 
             
            
            <a href="mailto:waruqi@gmail.com" title="email"><i class="fa fa-envelope-o" aria-hidden="true"></i></a> 
            
            
            <a href="https://twitter.com/waruqi" title="Twitter"><i class="fa fa-twitter" aria-hidden="true"></i></a> 
            
            <a href="/feed.xml" title="feed"><i class="fa fa-feed" aria-hidden="true"></i></a> 
        </p>
        <p class="power">
            <span>
                Site powered by <a href="https://jekyllrb.com/">Jekyll</a> & <a href="https://github.com/Gaohaoyang">HyG</a> & <a href="https://pages.github.com/">Github Pages</a>.
            </span>
        </p>
    </div>
</footer>

    <div class="back-to-top">
    <a href="#top" class="scroll">
        <i class="fa fa-arrow-up" aria-hidden="true"></i>
    </a>
</div>

    <script src=" /js/main.js " charset="utf-8"></script>
    <script src=" /js/scroll.min.js " charset="utf-8"></script>
  </body>

</html>
